﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutoClick.Algorithms
{
    /// <summary>
    /// Class managing algorithms as a strategy pattern
    /// </summary>
    public class AutoClickAlgorithmManager
    {
        #region Variable and constructor
        private IAutoClickAlgorithm _autoClickAlgorithm;
        public IAutoClickAlgorithm AutoClickAlgorithm
        {
            get
            {
                return _autoClickAlgorithm;
            }
            set
            {
                if (_autoClickAlgorithm != null)
                    Stop();
                _autoClickAlgorithm = value;
            }
        }
        #endregion

        #region Set method Start and Stop
        public void Start()
        {
            _autoClickAlgorithm.Start();
        }
        public void Stop()
        {
            _autoClickAlgorithm.Stop();
        }
        #endregion
    }
}
